/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util;

import java.io.File;
import org.jaudiotagger.audio.AudioFile;
import org.jaudiotagger.audio.AudioFileIO;
import org.jaudiotagger.tag.FieldKey;
import org.jaudiotagger.tag.Tag;

/**
 *
 * @author Antoine Boulinguez et Shyn-Yuan Cheng
 */
public class JaudioTaggerTest {

    public static void main(String[] args) throws Exception {
        AudioFile f = AudioFileIO.read(new File("F:\\Ma musique\\Iron Maiden\\Iron Maiden - 1992 - Fear Of The Dark\\09-The Apparition.mp3"));
        Tag tag = f.getTag();

        System.out.println(tag.getFirst(FieldKey.ARTIST));
        System.out.println(tag.getFirst(FieldKey.ALBUM));
        System.out.println(tag.getFirst(FieldKey.TITLE));
        System.out.println(tag.getFirst(FieldKey.COMMENT));
        System.out.println(tag.getFirst(FieldKey.YEAR));
        System.out.println(tag.getFirst(FieldKey.TRACK));
        System.out.println(tag.getFirst(FieldKey.DISC_NO));
        System.out.println(tag.getFirst(FieldKey.COMPOSER));
        System.out.println(tag.getFirst(FieldKey.ARTIST_SORT));
        System.out.println(f.getAudioHeader().getTrackLength()/60 + "min" + f.getAudioHeader().getTrackLength()%60 + "sec");
    }
}
